﻿using System;
using EzDesk.Core.Model;
using EzDesk.DesktopClient.ServiceLocator;
using EzDesk.DesktopClient.ServiceLocator.CoreClientService;
using EzDesk.DesktopClient.ViewContract;
using EzDesk.DesktopClient.MVVMEnhance;

namespace EzDesk.DesktopClient.UtilityView.ViewModel
{
    public interface ITopPanelViewModel
    {
    }

    public class TopPanelViewModel: ViewModelWithSingleContainer<ITopPanelView>, ITopPanelViewModel
    {
        private ICoreClientService Service
        { get { return ServiceFactory.CoreClientService; } }

        private Organization _organizationModel;

        public Organization OrganizationModel
        {
            get
            {
                if (_organizationModel == null)
                    try
                    {
                        _organizationModel = Service.GetOrganizationInfo();
                    }
                    catch (Exception)
                    {
                        
                    }
                return _organizationModel;
            
            }
            set { _organizationModel = value; }

        }

        public TopPanelViewModel()
            : base()
        {
        }
    }
}
